local animation_iocns = {}
for a=1,10 do
    local iocn = class.panel.create('',0,0,5,5)
    iocn:hide()
    animation_iocns[a] = iocn
end


ac.game:event '动画-播放拖动'(function(_,art,tween)
    local subject = tween.subject
    local icon = table.remove(animation_iocns,1)
    iocn.tween = tween
    iocn:set_normal_image(art)
    iocn:set_position(subject.x,subject.y)
    iocn:set_control_size(subject.w,subject.h)
    table.insert(animation_iocns,iocn)
end)





ac.hardware:on("界面绘制")(function(_,delta)
    for i,iocn in ipairs(animation_iocns) do
        local tween = iocn.tween
        if iocn:is_show() and tween and tween.clock >= tween.duration then
            local subject = tween.subject
            tween:set(self.clock + delta)
            iocn:set_position(subject.x,subject.y)
            iocn:set_control_size(subject.w,subject.h)
            iocn:show()
        else
            iocn:hide()
        end
        
    end
end)
